/*
 * @Author: DUST
 * @Date: 2024-11-11 15:47:46
 * @LastEditors: DUST
 * @LastEditTime: 2024-11-11 15:47:46
 * @FilePath: \business-card-system\server\app\validator\BusinessCardUserValidator.ts
 * @Description: 
 * undefined
 */
import { Rules } from "async-validator";

export interface BusinessCArdUserItem  {
  name?: string;
  addr?: string;
  avatar?: string;
  wxNumber?: string;
  mobile?: string;
  email?: string;
  job?: string;
  miniQrcode?: string;
  id?: number;
  companyName?: string;
}

class BusinessCardUserValidator {
  private _addRules: Rules = {
    name: [
      {
        type: "string",
        required: true,
        message: "请输入姓名"
      }
    ],
    mobile: [
      {
        type: "string",
        required: true,
        message: "请输入手机号"
      }
    ],
    addr: [
      {
        type: "string",
        required: true,
        message: "请输入办公地址"
      }
    ],
    companyName: [
      {
        type: "string",
        required: true,
        message: "请选择公司名称"
      }
    ],
    email: [
      {
        type: "string",
        required: true,
        message: "请输入邮箱"
      }
    ]
  }
  public get addRules() : Rules {
    return this._addRules;
  }
  private _editRules: Rules = {
    name: [
      {
        type: "string",
        required: true,
        message: "请输入姓名"
      }
    ],
    mobile: [
      {
        type: "string",
        required: true,
        message: "请输入手机号"
      }
    ],
    addr: [
      {
        type: "string",
        required: true,
        message: "办公地址不能为空"
      }
    ],
    companyName: [
      {
        type: "string",
        required: true,
        message: "请选择公司名称"
      }
    ],
    email: [
      {
        type: "string",
        required: true,
        message: "请输入邮箱"
      }
    ]
  }
  public get editRules() : Rules {
    return this._editRules;
  }
}

export default new BusinessCardUserValidator;